home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 March / CHIP Mart 1997.iso / SurfCam / SURFCAM.Z / MAH-G18S.M3 < prev    next >
Encoding:
Text File  |  1996-04-01  |  5.2 KB  |  185 lines

  1. name Maho XY Plane G18 Sub Program
  2.  
  3. ! 00
  4. % 00
  5. O >4 N Add 9100
  6. N >9
  7. G >2
  8. o >4 N Add 9100
  9. B ->3.>4
  10. b ->3.>4 B
  11. X ->3.>4
  12. x ->3.>4 X
  13. Z ->3.>4 Mult -1
  14. z ->3.>4 Z Mult -1
  15. Y ->3.>4
  16. y ->3.>4 Y
  17. I ->3.>4
  18. i ->3.>4 I
  19. J ->3.>4
  20. K ->3.>4 Mult -1
  21. k ->3.>4 K
  22. F >4
  23. T >2
  24. M >2
  25. S >4
  26. W 00 
  27.  
  28. ModalLetters X Z Y F B                # List of letters that are modal    
  29.  
  30. ModalGs 0 1 2 3 81 83 84              # List of g codes that are modal    
  31.  
  32. Sequence#s N 1 1 1                    # Char, freq, incr & start          
  33. First#? N                             # Y or N  'Output 1st sequence no.  
  34. Last#? N                              # Y or N  'Output last sequence no. 
  35.  
  36. HCode X                               # X or X U  'Horizontal char.       
  37. VCode Z                               # Y or Y V  'Vertical char.         
  38. Dcode Y                               # Depth char.                       
  39. FeedCode F                            # Feed rate char.                   
  40.  
  41. Comment ( )                           # Begin End comment char.           
  42.  
  43. Spindle 3 4 5                         # Cw, ccw & stop m codes            
  44. Coolant 8 9 7                         # On, Off & Mist m codes            
  45. DComp 41 42 40                        # Left, Right & Cancel m codes      
  46. LComp 43 49                           # On & Off codes                    
  47.  
  48. Feed G1                             # Linear move                       
  49. Rapid G0                            # Rapid positioning word            
  50. Cw G2                               # Circular move clockwise           
  51. Ccw G3                              # Circular move counter clockwise   
  52.  
  53. Inc/Abs G 91 90                       # Inc & Abs char. & values          
  54.  
  55. CtrCode I K                           # I J or R or I J K L               
  56. Helical? N
  57.  
  58. Spaces? Y                             # Y or N  'Spaces between words     
  59.  
  60. Incremental? N                        # Y or N  'Inc or abs output        
  61. CtrIncremental? N                     # Y or N  'Inc or abs I & J         
  62. ByQuadrants? N                        # Y or N  'Break arcs at quadrants  
  63.  
  64. Inch/MM 70 71                         # Inch & Metric g codes             
  65.  
  66. Subs1st? N                            # Y or N 'Orders main & sub programs
  67.  
  68. RenumSubs? Y                          # Y or N  'Resets sub's sequence no.
  69.  
  70. UppercaseComments? Y                  # Y or N 'Require uppercase comments
  71.  
  72. Drill 2                               # Drilling canned/manual cycle      
  73. G81 z[Depth] b[Rplane] S[Speed] F[Frate] M13 y2
  74. G79 X[H] Z[V] Y[PointD]
  75. G79 X[H] Z[V] Y[PointD]
  76. end
  77.  
  78. Peck 2                                # Pecking canned/manual cycle       
  79. G83 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2 k[VBite]
  80. G79 X[H] Z[V] Y[PointD]
  81. G79 X[H] Z[V] Y[PointD]
  82. end
  83.  
  84. Tap 2                                 # Tapping canned/manual cycle       
  85. G84 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2
  86. G79 X[H] Z[v] Y[PointD]
  87. G79 X[H] Z[v] Y[PointD]
  88. end
  89.  
  90. Ream 2                                # Reaming canned/manual cycle       
  91. G85 z[Depth] b[RPlane] S[Speed] F[Frate] M13 y2
  92. G79 X[H] Z[V] Y[PointD]
  93. G79 X[H] Z[V] Y[PointD]
  94. end
  95.  
  96. Bore 2                                # Boring canned/manual cycle        
  97. G86 z[Depth] b[Rplane] S[Speed] F[Frate] M13 y2
  98. G79 X[H] Z[V] Y[PointD]
  99. G79 X[H] Z[V] Y[PointD]
  100. end
  101.  
  102. Back                                  # Back boring canned/manual cycle   
  103. end cancel
  104.  
  105. Cancel                                # Cancel a canned/manual cycle      
  106. G80
  107. end
  108.  
  109. StartCode                             # Start of the program              
  110. !0 %0
  111. !0 O[Program#]
  112. G[unitmode]
  113. End
  114.  
  115. 1stToolChange                         # First tool change                 
  116. G18 T[Tool] M[Val6]
  117. G51
  118. G52
  119. G53
  120. G[Val8]
  121. G90
  122. G0 X[H] Z[V] Y[D] S[Speed] F[FRate] M13
  123. End
  124.  
  125. Infeed                                # Enable cutter comp                
  126. G1 Y[D] F[Plunge]
  127. G43 X[H] Z[V] F[FRate]
  128. G[Side]
  129. end
  130.  
  131. Outfeed                               # Disable cutter comp               
  132. G40
  133. G1 X[H] Z[V]
  134. end
  135.  
  136. ToolChange                            # Secondary tool changes            
  137. G0 Y[Val7]
  138. T[Tool] M[Val6]
  139. G0 X[H] Z[V] Y[D] S[Speed] F[FRate] M13
  140. End
  141.  
  142. LineCode                              # Linear move                       
  143. G1 X[H] Z[V] Y[D] F[Frate]
  144. End
  145.  
  146. RapidCode                             # Rapid move                        
  147. G0 X[H] Z[V] Y[D]
  148. End
  149.  
  150. CwCode                                # CW circular move                  
  151. G2 X[H] Z[V] I[IVal] K[JVal] F[Frate]
  152. End
  153.  
  154. CcwCode                               # CCW circular move                 
  155. G3 X[H] Z[V] I[IVal] K[JVal] F[Frate]
  156. End
  157.  
  158. Between                               # Between the main and sub programs 
  159. G0 Y[Val7]
  160. G53
  161. M30
  162. !0 W0
  163. End
  164.  
  165. SubCall                               # Call a sub program                
  166. G[Work] X[H] Z[V]
  167. G22 o[Sub]
  168. End
  169.  
  170. SubStart                              # Start of the sub program          
  171. !0 %0
  172. !0 o[Sub]
  173. End
  174.  
  175. SubEnd                                # End of the sub program            
  176. M02
  177. !0 W0
  178. End
  179.  
  180. Ask [Val7] " Enter clearance for toolchange in Y : " "100"
  181. Ask [Val6] " Enter M-function for toolchange : " "6"
  182. Ask [Val8] " Enter Offset number : " "54"
  183.  
  184. Replace "%" with "%PM"
  185.